//
//  MainViewController+FixedTab.m
//  RSW.IOS
//
//  Created by zhaiqiuqiu on 2018/1/23.
//  Copyright © 2018年 com.xtion.crm. All rights reserved.
//

#import "MainViewController+FixedTab.h"
#import "MineViewController.h"
#import "WorkflowMenuListViewController.h"
#import "FunctionMenuListViewController.h"
#import "InformationMenuListViewController.h"

@implementation MainViewController (FixedTab)

-(NSArray*)getTabItem
{
    XUITabBarItem *item1 = [[XUITabBarItem alloc] initWithTitle:@"主页" image:[[UIImage imageNamed:@"tabbar_home"] imageWithRenderingMode:UIImageRenderingModeAlwaysOriginal] selectedImage:[[UIImage imageNamed:@"tabbar_home_selected"] imageWithRenderingMode:UIImageRenderingModeAlwaysOriginal] tag:0];
    XUITabBarItem *item2 = [[XUITabBarItem alloc] initWithTitle:@"工作流" image:[[UIImage imageNamed:@"tabbar_workflow"] imageWithRenderingMode:UIImageRenderingModeAlwaysOriginal] selectedImage:[[UIImage imageNamed:@"tabbar_workflow_selected"] imageWithRenderingMode:UIImageRenderingModeAlwaysOriginal] tag:1];
    XUITabBarItem *item3= [[XUITabBarItem alloc] initWithTitle:@"我的" image:[[UIImage imageNamed:@"tabbar_me"] imageWithRenderingMode:UIImageRenderingModeAlwaysOriginal] selectedImage:[[UIImage imageNamed:@"tabbar_me_selected"] imageWithRenderingMode:UIImageRenderingModeAlwaysOriginal] tag:2];
    
    return @[item1,item2,item3];
}

- (void)createViewControllerClassAtIndex:(NSUInteger)index block:(void (^)(Class cls, XUIViewControllerSwitchParam *param))block
{
    [self defaultCreateViewControllerClassAtIndex:index block:block];
}

- (void)defaultCreateViewControllerClassAtIndex:(NSUInteger)index block:(void (^)(Class cls, XUIViewControllerSwitchParam *param))block
{
    switch(index)
    {
        case 0:
        {
            block([FunctionMenuListViewController class], nil);
            break;
        }
        case 1:
        {
            block([WorkflowMenuListViewController class],nil);
            break;
        }
        case 2:
        {
            XUIViewControllerSwitchParam *p = [XUIViewControllerSwitchParam new];
            p.param[MineViewControllerMenuCodeParamKey] = @"ROOT_PERSONAL_CENTER";
            
            block([MineViewController class],p);
            break;
        }
    }
}
@end
